import request from "@/utils/request";

// 查询EduClassroom列表
// 有schoolId则是学校下面的班级列表
export function listEduClassroom(query, schoolId) {
    let url = "/api/v1/edu/classroomList";
    if (schoolId) {
        url = `/api/v1/edu/schoolInfo/${schoolId}/classroomList`;
    }
    return request({
        url,
        method: "get",
        params: query
    });
}

// 查询EduClassroom详细
export function getEduClassroom(classroomId) {
    return request({
        url: "/api/v1/edu/classroom/" + classroomId,
        method: "get"
    });
}

// 新增EduClassroom
export function addEduClassroom(data) {
    return request({
        url: "/api/v1/edu/classroom",
        method: "post",
        data: data
    });
}

// 修改EduClassroom
export function updateEduClassroom(data) {
    return request({
        url: "/api/v1/edu/classroom",
        method: "put",
        data: data
    });
}

// 删除EduClassroom
export function delEduClassroom(classroomId) {
    return request({
        url: "/api/v1/edu/classroom/" + classroomId,
        method: "delete"
    });
}
